package com.ebt.m.policy;

import android.os.Bundle;

import com.ebt.m.R;
import com.ebt.m.activity.BaseToolBarActivity;
import com.ebt.m.data.rxModel.apibean.ProductItemsBean;
import com.ebt.m.policy.bean.BrandProductTitle;
import com.ebt.m.policy.view.BrandsProductListAllView;

import org.greenrobot.eventbus.EventBus;

import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * @author Damon.Han
 */
public class ActBrandProductsAll extends BaseToolBarActivity {
    @BindView(R.id.brands_product_list)
    BrandsProductListAllView brandsProductListAllView;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_online_policy_product_all);
        ButterKnife.bind(this);

    }

    @Override
    protected void init() {
        super.init();
        BrandProductTitle title = (BrandProductTitle) getIntent().getSerializableExtra("data");
        if (title == null) {
            return;
        }
        List<ProductItemsBean> list = title.getProductItems();
        brandsProductListAllView.update(list);
        setTitle(title.getName());
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        EventBus.getDefault().unregister(this);
    }

}
